<?php
	session_start();

	include("mysql_connect.php");
	
	if( $_POST['isSale'] == "true"  )
	{
		$strKey = ' WHERE Category_idCategory != 5';
	}
	else
	{ 
		$strKey = ' WHERE Category_idCategory = 5';
	}
	
	$strSqlCommand = "SELECT MAX(LotSize)
						FROM ResidentialProperty tbRP" . $strKey;
//						LEFT JOIN CurrencyFormat tbCF	ON tbLD.Price = tbCF.idCurrencyFormat
//						LEFT JOIN Listing  tbLT			ON tbRP.Listing_idListing = tbLT.idListing
//						LEFT JOIN ListingData tbLD		ON tbLT.ListingData_idListingData = tbLD.idListingData
//						LEFT JOIN StreetAddress  tbSA	ON tbLT.StreetAddress_idStreetAddress = tbSA.idStreetAddress
		
	//echo $strSqlCommand;
	$result = mysql_query($strSqlCommand);
	$rowMax = @mysql_fetch_array($result);

	//echo $rowMax['0']. " " . $rowMax['1'] . " " . pow( 10, strlen( $rowMax['0'] / 5) ) ."<br/>";
	
	$nRange = pow( 10, strlen( $rowMax['0'] ) - 1) ;
	echo '<option selected="selected" value="-1">Any</option>';
//	echo 'Any<br>';
//		echo "<p>".NumberToPrice($rowDetail['Currency'])."</p>";
		//echo $strSqlCommand;
		for( $i = 0 ; $i < 5 ; $i++ )
		{// URL, Price,idListing
			echo '<option value="'.$nRange*$i.'">'. $nRange*$i. '+ Sq.Ft.</option>';
//			echo ($nRange * $i)  .' - '.  $nRange * ($i+1).' <br/>';
		}
//		echo ( $nRange * 4)  .' + <br/>';
	
?>